﻿<UserControl x:Class="Con10uumSample.Tiroir"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             xmlns:i="http://schemas.microsoft.com/expression/2009/interactivity"
             xmlns:ShaderEffectLibrary="clr-namespace:ShaderEffectLibrary;assembly=ShaderEffectLibrary"
             xmlns:ZillloBlend="clr-namespace:Con10uumSample"
             d:DesignHeight="300" 
             d:DesignWidth="400" 
             x:Name="TiroirControl" 
             RenderTransformOrigin="0.5,0.5" >
  <UserControl.Resources>		
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="2" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="TiroirButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid Height="Auto" Width="Auto">
							<Rectangle Stroke="Black" RadiusX="5" RadiusY="5">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FFB6B6B6" Offset="0"/>
										<GradientStop Color="#FF878787" Offset="1"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Border HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" CornerRadius="5" ClipToBounds="False" BorderThickness="1" Background="#FF3C3C3C">
								<ContentPresenter Width="Auto" Height="Auto" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
							</Border>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>		
	</UserControl.Resources>
	<UserControl.RenderTransform>
		<TransformGroup>
			<ScaleTransform/>
			<SkewTransform/>
			<RotateTransform/>
			<TranslateTransform X="535" />
		</TransformGroup>
	</UserControl.RenderTransform>
    	<Grid x:Name="grid1" Width="Auto" RenderTransformOrigin="0.5,0.5">
    		<VisualStateManager.VisualStateGroups>
    			<VisualStateGroup x:Name="ExpandStateGroup">
    				<VisualStateGroup.Transitions>
    					<VisualTransition GeneratedDuration="00:00:00.2000000"/>
    				</VisualStateGroup.Transitions>
    				<VisualState x:Name="Expanded">
    					<Storyboard>
    						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="TiroirControl" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
    							<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
    							<SplineDoubleKeyFrame KeyTime="00:00:00" Value="535"/>
    						</DoubleAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualState>
    				<VisualState x:Name="Collapsed"/>
    			</VisualStateGroup>
    			<VisualStateGroup x:Name="TimerStateGroup">
    				<VisualStateGroup.Transitions>
    					<VisualTransition GeneratedDuration="00:00:00.3000000"/>
    				</VisualStateGroup.Transitions>
    				<VisualState x:Name="Start"/>
    				<VisualState x:Name="End" >
    					<Storyboard>
    						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[1].(GradientStop.Offset)">
    							<SplineDoubleKeyFrame Value="0"/>
    						</DoubleAnimationUsingKeyFrames>
    						<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.OpacityMask).(GradientBrush.GradientStops)[0].(GradientStop.Offset)">
    							<SplineDoubleKeyFrame  Value="0"/>
    						</DoubleAnimationUsingKeyFrames>
    					</Storyboard>
    				</VisualState>
    			</VisualStateGroup>
    		</VisualStateManager.VisualStateGroups>
    	<Border Width="600" x:Name="SlidingBorder" BorderBrush="#FF545454" BorderThickness="1" CornerRadius="30,0,0,30" d:LayoutOverrides="HorizontalAlignment, Width" Margin="0" RenderTransformOrigin="0.5,0.5">
    			<Border.RenderTransform>
    				<TransformGroup>
    					<ScaleTransform/>
    					<SkewTransform/>
    					<RotateTransform/>
    					<TranslateTransform/>
    				</TransformGroup>
    			</Border.RenderTransform>    			        
    			<Grid>    			        
    				<WrapPanel x:Name="WrapContent" Margin="70,20,0,20">
    					<Button x:Name="ShowRoom1" Margin="5" Style="{DynamicResource TiroirButtonStyle}" BorderThickness="0" Width="200" Height="200">
    						<Image Source="images/WebBrowser.png" Stretch="None"/>
    					</Button>    			
    				</WrapPanel>
    			</Grid>
    		</Border>
    	<Grid x:Name="grid" HorizontalAlignment="Left" RenderTransformOrigin="0.5,0.5" Margin="0" Background="#00000000">
    		<Grid.RenderTransform>
    			<TransformGroup>
    				<ScaleTransform/>
    				<SkewTransform/>
    				<RotateTransform/>
    				<TranslateTransform/>
    			</TransformGroup>
    		</Grid.RenderTransform>
    		<Grid x:Name="TimerButtonGrid" Margin="0" Background="#00000000">
    			<Path x:Name="TimerButton" Stretch="Fill" Stroke="Black" Data="M0.29897202,17.153059 L124.50033,-0.37516247 124.50033,34.166652" StrokeThickness="0" Width="40" Height="40" Fill="#FFB10F0F" Margin="0" d:LayoutOverrides="VerticalAlignment">
    				<Path.Effect>
    					<DropShadowEffect ShadowDepth="2"/>
    				</Path.Effect>
    			</Path>
						
    			<!--<Button x:Name="TimerButton" Style="{DynamicResource SimpleButton}" Content="Button" Cursor="Hand" Margin="5,0,9,0" Background="#FFB10F0F" >
    				<Button.Effect>
    					<DropShadowEffect ShadowDepth="2"/>
    				</Button.Effect>
    			</Button>-->
    		</Grid>
    		<Ellipse x:Name="ellipse" Stroke="White" HorizontalAlignment="Center" VerticalAlignment="Center" Width="60" Height="60" StrokeThickness="5" Margin="10,0,0,0">
    			<Ellipse.OpacityMask>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" MappingMode="RelativeToBoundingBox">
    					<GradientStop Color="#00000000" Offset="1"/>
    					<GradientStop Color="Black" Offset="1"/>
    				</LinearGradientBrush>
    			</Ellipse.OpacityMask>
    			<Ellipse.Effect>
    				<BlurEffect/>
    			</Ellipse.Effect>
    		</Ellipse>
    	</Grid>    		
    </Grid>
</UserControl>
